import Vue from 'vue'
import Router from 'vue-router'
import layout from '@/layout/index.vue'

Vue.use(Router)
//获取原型对象上的push函数
const originalPush = Router.prototype.push
//修改原型对象中的push方法
Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
			redirect:'/index',
			component: layout,
			children:[
				{
					name:'首页',
					path:'/index',
					component:() => import ('@/views/index/index.vue')
				},
				{
					name:'学校概况',
					path:'/general/index',
					component:() => import ('@/views/general/index.vue')
				},
				{
					name:'校园内外',
					path:'/inside/index',
					component:() => import ('@/views/inside/index.vue')
				},
				{
					name:'师资力量',
					path:'/teachers/index',
					component:() => import ('@/views/teachers/index.vue')
				},
				{
					name:'专业设置',
					path:'/majorSetup/index',
					component:() => import ('@/views/majorSetup/index.vue')
				},
				{
					name:'校园风采',
					path:'/mine/index',
					component:() => import ('@/views/mine/index.vue')
				},
				{
					name:'老教工作',
					path:'/work/index',
					component:() => import ('@/views/work/index.vue')
				},
				{
					name:'学生之窗',
					path:'/student/index',
					component:() => import ('@/views/student/index.vue')
				},
				{
					name:'法律声明',
					path:'/legalNotice/index',
					component:() => import ('@/views/legalNotice/index.vue')
				},
				{
					name:'网站地图',
					path:'/map/index',
					component:() => import ('@/views/map/index.vue')
				},
				{
					name:'联系我们',
					path:'/contactUs/index',
					component:() => import ('@/views/contactUs/index.vue')
				},
				{
					name:'关于本站',
					path:'/onSite/index',
					component:() => import ('@/views/onSite/index.vue')
				},
				{
					name:"详情",
					path:'/detail/index',
					component:() => import ('@/views/detatil/index.vue')
				},
        {
        	name:"详情s",
        	path:'/details/index',
        	component:() => import ('@/views/detatils/index.vue')
        },
        {
        	name:"群众路线专题",
        	path:'/qun/index',
        	component:() => import ('@/views/qun/index.vue')
        },
        {
          name:'专题专栏',
          path:'/subject/index',
          component:() => import ('@/views/subject/index.vue')
        },
        {
          name:'教学研究',
          path:'/research/index',
          component:() => import ('@/views/research/index.vue')
        },
        {
          name:'消息通知',
          path:'/mess/index',
          component:() => import ('@/views/mess/index.vue')
        }
			]
    },
    {
      path: '/djxx/index',
      name: 'sxx',
      component: () => import ('@/views/djxx/index.vue'),
    }
  ]
})
